#!/bin/bash

echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'
echo ' __        __        _   ____   ____ _                 _ 
 \ \      / /__  ___| |_|___ \ / ___| | ___  _   _  __| |
  \ \ /\ / / _ \/ __| __| __) | |   | |/ _ \| | | |/ _` |
   \ V  V /  __/\__ \ |_ / __/| |___| | (_) | |_| | (_| |
    \_/\_/ \___||___/\__|_____|\____|_|\___/ \__,_|\__,_|'                                    
read -p "是否安装宝塔面板 (y/n): " choice

choice=$(echo "$choice" | tr '[:upper:]' '[:lower:]')

if [ "$choice" = "y" ]; then
    echo "即将开始安装宝塔7.7版本"
    read -p "请输入我们官网域名: " verification_code

    if [ "$verification_code" = "west2cloud.cn" ]; then
        echo "================================================"
        read -p "按下回车键后开始安装" 
        echo "正在安装宝塔面板，请稍候..."

        curl -O https://gitee.com/silly-spring-network/btpanel/raw/master/install.sh && chmod +x install.sh && ./install.sh
        
        sleep 5
        echo "宝塔面板安装完成！"
    else
        echo "验证码错误，请访问官网获取正确的验证码。"
    fi
elif [ "$choice" = "n" ]; then
    echo "取消安装宝塔面板。"
else
    echo "无效的选择，请输入 'y' 或 'n'。"
fi